﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<SuperStore.Models.CartItem>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Checkout</h2>
    <h2>
        Total:
        <%: string.Format("{0:F}", ViewData["Total Cost"]) %>
        and
        <%: ViewData["Total Points"] %>
        MS Points</h2>
    <div class="button">
        <%: Html.ActionLink("Confirm Check Out","confirmcheckout","cart") %></div>
    <table>
        <tr>
            <th>
                Game
            </th>
            <th>
                Quantity
            </th>
            <th>
                Cost
            </th>
            <th>
                Total Cost
            </th>
        </tr>
        <% foreach (var item in Model)
           { %>
        <tr>
            <td>
                <%: item.Title %>
            </td>
            <td><%: item.Quantity %></td>
            <td><% if (item.Arcade)
                   {%>
                <%: item.MSPoints %>
                points
                <%}
                   else
                   {%>
                <%: String.Format("{0:F}", item.RetailCost) %>
                <%}%></td>
            <td><% if (item.Arcade)
                   {%>
                <%: item.MSPoints * item.Quantity %>
                points<%}
                   else
                   {%>
                <%: String.Format("{0:F}", item.RetailCost * item.Quantity) %>
                <%}%></td>
        </tr>
        <% } %>
    </table>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
